package jp.co.sn.mml.pojo.tmhksitem;

import jp.co.sn.mml.pojo.tmsst.Tmsst;

public class TmhksitemId implements java.io.Serializable { 

	//コード区分
	private String cdKbn;
	//コード
	private Tmsst code;
	//報告書コード
	private String hksCd;

	/** default constructor */
	public TmhksitemId(){

	}

	/** full constructor */
	public TmhksitemId(String cdKbn,Tmsst code,String hksCd){
		this.cdKbn = cdKbn;
		this.code = code;
		this.hksCd = hksCd;
	}

	//Property accessors
	public String getCdKbn(){
		return this.cdKbn;
	}

	public void setCdKbn(String cdKbn){
		this.cdKbn=cdKbn;
	}

	public Tmsst getCode(){
		return this.code;
	}

	public void setCode(Tmsst code){
		this.code=code;
	}

	public String getHksCd(){
		return this.hksCd;
	}

	public void setHksCd(String hksCd){
		this.hksCd=hksCd;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TmhksitemId))
			return false;

		TmhksitemId castOther = (TmhksitemId) other;

		return ((this.getCdKbn() ==  castOther.getCdKbn())
				||(this.getCdKbn()!=null && castOther.getCdKbn() !=null 
					&& castOther.getCdKbn() !=null 
					&& this.getCdKbn().equals(castOther.getCdKbn())))
			&& ((this.getCode() ==  castOther.getCode())
				||(this.getCode()!=null && castOther.getCode() !=null 
					&& castOther.getCode() !=null 
					&& this.getCode().equals(castOther.getCode())))
			&& ((this.getHksCd() ==  castOther.getHksCd())
				||(this.getHksCd()!=null && castOther.getHksCd() !=null 
					&& castOther.getHksCd() !=null 
					&& this.getHksCd().equals(castOther.getHksCd())))
;	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCdKbn() == null ? 0 : this.getCdKbn().hashCode());
		result = 37 * result
				+ (getCode() == null ? 0 : this.getCode().hashCode());
		result = 37 * result
				+ (getHksCd() == null ? 0 : this.getHksCd().hashCode());
		return result;
	}

}